/* GUI CONVERTED from rwroiq.p (converter v1.75) Wed May 16 13:34:17 2001 */
/* rwroiq.p - ROUTING INQUIRY                                           */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* $Revision: 1.9.1.3 $                                                     */
/*V8:ConvertMode=Report                                                 */
/* REVISION: 1.0      LAST MODIFIED: 04/07/86   BY: PML */
/* REVISION: 1.0      LAST MODIFIED: 01/17/86   BY: EMB */
/* REVISION: 2.1      LAST MODIFIED: 08/25/87   BY: WUG *A94**/
/* REVISION: 2.1      LAST MODIFIED: 10/19/87   BY: EMB */
/* REVISION: 2.1      LAST MODIFIED: 11/04/87   BY: WUG *A101**/
/* REVISION: 4.0          LAST EDIT: 12/30/87   BY: WUG *A137**/
/* REVISION: 4.0      LAST MODIFIED: 02/17/88   BY: RL  *A171**/
/* REVISION: 5.0      LAST MODIFIED: 12/29/88   BY: RL        */
/* REVISION: 5.0          LAST EDIT: 05/03/89   BY: WUG *B098**/
/* REVISION: 6.0      LAST MODIFIED: 03/06/90   BY: EMB  *D001*/
/* REVISION: 6.0      LAST MODIFIED: 07/12/90   BY: WUG       */
/* REVISION: 6.0      LAST MODIFIED: 11/02/90   BY: emb *D175**/
/* Revision: 7.3          Last edit: 11/19/92   By: jcd *G339**/
/* REVISION: 7.3          LAST EDIT: 02/24/93   BY: sas *G740**/
/* REVISION: 7.4      LAST MODIFIED: 01/12/94   BY: qzl *H276*/
/* REVISION: 7.4      LAST MODIFIED: 08/28/94   BY: srk *GL73*/
/* REVISION: 8.5      LAST MODIFIED: 07/29/96   BY: *J12T* Sue Poland         */
/* REVISION: 8.6      LAST MODIFIED: 10/15/97   BY: bvm *K108**/
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane          */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan         */
/* REVISION: 8.6E     LAST MODIFIED: 10/12/98   BY: *J326* Sandesh Mahagaokar */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane   */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* myb                */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* $Revision: 1.9.1.3 $    BY: Hualin Zhong   DATE: 05/04/01 ECO: *N0YC*          */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* Note: Changes made here may be necessary in fsroiq.p also. */

/* DISPLAY TITLE */

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE rwroiq_p_1 "Effective"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

define variable part           like ro_routing.
define variable desc1          like pt_desc1.
define variable wkctr          like ro_wkctr format "x(24)".
define variable effdate        like ro_start label {&rwroiq_p_1}.
define variable service-desc   as character format "x(24)".

part = global_part.


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
space(1)
   part
   desc1   no-label
   effdate colon 13
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:HIDDEN in frame a = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5.  /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

assign
   effdate = today
   service-desc = getTermLabel("SERVICE_ROUTING",24).

{wbrp01.i}

repeat:

   if c-application-mode <> 'web' then
      update part effdate with frame a
   editing:

      /* FIND NEXT/PREVIOUS RECORD */
      /* NEXT/PREV THROUGH NON-SERVICE ROUTINGS ONLY */
      {mfnp05.i ro_det ro_fsm_type
         "ro_fsm_type = "" "" " ro_routing
         "input part"}

      if recno <> ? then do:
         part = ro_routing.
         desc1 = "".
         find pt_mstr where pt_part = part no-lock no-error.
         if available pt_mstr then desc1 = pt_desc1.
         display part desc1 with frame a.
         recno = ?.
      end.
   end.    /* editing on part */
   status input.

   {wbrp06.i &command = update &fields = "  part effdate" &frm = "a"}

   if (c-application-mode <> 'web') or
      (c-application-mode = 'web' and
      (c-web-request begins 'data')) then do:

      find pt_mstr where pt_part = part no-lock no-error.
      desc1 = "".
      if available pt_mstr then desc1 = pt_desc1.
      else
      if can-find (first ro_det where ro_routing = part
         and ro_fsm_type = "FSM") then
         desc1 = service-desc.

      display desc1 with frame a.
      hide frame b.

   end.

   /* OUTPUT DESTINATION SELECTION */
   {gpselout.i &printType = "terminal"
               &printWidth = 80
               &pagedFlag = " "
               &stream = " "
               &appendToFile = " "
               &streamedOutputToTerminal = " "
               &withBatchOption = "no"
               &displayStatementType = 1
               &withCancelMessage = "yes"
               &pageBottomMargin = 6
               &withEmail = "yes"
               &withWinprint = "yes"
               &defineVariables = "yes"}
/*GUI*/ RECT-FRAME:HEIGHT-PIXELS in frame a = FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.


   for each ro_det where ro_routing = part
         and ((effdate  = ?) or
         ((effdate  <> ?) and
         (ro_start = ? or ro_start <= effdate) and
         (ro_end   = ? or ro_end >= effdate)))
         no-lock by ro_routing by ro_op
      with frame b width 80 no-attr-space:

      /* SET EXTERNAL LABELS */
      setFrameLabels(frame b:handle).
      
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/


      wkctr = ro_wkctr.
      find wc_mstr where wc_wkctr = ro_wkctr and wc_mch = ro_mch
         no-lock no-error.
      if available wc_mstr then wkctr = wkctr + " " + wc_desc.

      display
         ro_op
         wkctr
         ro_mch
         ro_setup
         ro_run
         ro_move
         ro_yield WITH STREAM-IO /*GUI*/ .

      down 1.
      display ro_desc @ wkctr WITH STREAM-IO /*GUI*/ .
   end.    /* for each ro_det */

   {mfreset.i}
/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

   {pxmsg.i &MSGNUM=8 &ERRORLEVEL=1}

end.   /* repeat */
global_part = part.

{wbrp04.i &frame-spec = a}
